const Roter=require('koa-router');

const { updateRoleByID,getRoles,addRole,getRoleDetail,delRoleByID} =require('../controller/role.controller')
const {authToken } = require('../middleware/user.middleware')

const roleRouter = new Roter({
  prefix: '/role'
});

roleRouter.post('/', authToken,getRoles)
roleRouter.post('/add', authToken,addRole) //
roleRouter.get('/:id', authToken,getRoleDetail)
roleRouter.delete('/:id', authToken,delRoleByID)
roleRouter.put('/:id', authToken,updateRoleByID)

module.exports = roleRouter;